package com.example.rpapp.award.command;


import com.example.rpapp.assembler.AwardAssembler;
import com.example.rpclient.dto.AwardUpdateCmd;
import com.example.rpclient.dto.data.AwardVo;
import com.example.rpdomain.award.AwardEntity;
import com.example.rpdomain.gateway.AwardGateway;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@AllArgsConstructor
public class AwardUpdateCmdExe {
    private final AwardGateway awardGateway;
    public AwardVo execute(AwardUpdateCmd cmd) {
        AwardEntity entity = awardGateway.save(AwardAssembler.toUpdateEntity(cmd));

        return AwardAssembler.toAwardVO(entity);
    }
}
